﻿#ifndef BASEWIDGET_H
#define BASEWIDGET_H

#include <QWidget>
class QResizeEvent;
class QCloseEvent;
class QFocusEvent;
class QToolButton;
class MouseEvent;

class BaseWidget : public QWidget
{
    Q_OBJECT
signals:
    void onClose();

//    void onMinimized(QWidget *sender);
//    void onMaximized(QWidget *sender);
//    void onRestored(QWidget *sender);

    void onClicked();
    void onFocuseOut();
    void onFocuseIn();
public:
    explicit BaseWidget(QWidget *parent = 0 ,bool IsShowBG = true);
    ~BaseWidget();

    void showWithAnimation(QWidget *widget);
private:

    QToolButton *btnclose;
    bool m_IsShowExtend;
protected:
    virtual void closeEvent(QCloseEvent *);
    virtual void focusOutEvent(QFocusEvent *);
    virtual void focusInEvent(QFocusEvent *);
    virtual void mouseReleaseEvent(MouseEvent *);
    virtual void resizeEvent(QResizeEvent *);
};

#endif // BASEWIDGET_H
